package com.forenow.oop;

public class practise {
    public static void main(String[] args) {
        practise pr = new practise();
        Student[] ss=pr.m1();
        for (Student s:ss) {
            System.out.println(s.getName()+"---"+s.getAge());
        }
    }
    public Student[] m1(){
        Student[] array = new Student[2];
        Student s1 = new Student();
        s1.setAge(17);
        s1.setName("sam");
        Student s2 = new Student();
        s2.setAge(20);
        s2.setName("fander");
        array[0]=s1;
        array[1]=s2;
        return array;
    }
}
